<?php 
define('_VIEW_MODEL_','admin');
session_start();
$_SESSION['statu'] = false;
require_once("../init.php");
$stip = " ";
if(isset($act)&&$act == "login"){
	$na = $name;
	$rs = $db->GetRow("select * from {$telper}admin where name = '$na'");
	$ps = md5($password);
	if($ps == $rs['password']){
		$_SESSION['name']  = $name;
		$_SESSION['time']  = $rs['lasttime'];
		$_SESSION['statu'] = true;
		$time = time();
		$id   = $rs['id'];
		$db->Execute("update {$telper}admin set `lasttime`= '$time' where `id` = '$id' ");
		header("Location:manage.php");
		exit;
	}else{
		header("Location:index.php?act=wrong");
		exit;
	}
}
if(isset($act)&&$act == "wrong"){
	$stip = $adminloginwrong;
}
//$oper = new mySmarty('admin');
$smartyObj->assign("title",$admintitle);
$smartyObj->assign("stip",$stip);
$smartyObj->display("login.tpl");
?>